import axios from '../untils/request'

export const guess =()=>axios({
    url:"/v1/cities?type=guess"
})

export const geohash =(latitude,longitude)=>axios({
    url:'/v2/pois/'+latitude+','+longitude,
})

export const entry =()=>axios({
    url:'/v2/index_entry'
})

//获取商品列表
export const shoppingList =params=>axios({
    url:'/shopping/restaurants',
    params
})

export const restaurantList =()=>axios({
    url:'/shopping/v2/restaurant/category'
})

export const restaurants=params=>axios({
    url:'http://elm.cangdu.org/shopping/restaurants',
    params
})

//餐厅详情
export const restaurantAll =id=>axios({
    url:"http://elm.cangdu.org/shopping/restaurant/"+id,
})

//菜单
export const menu =params=>axios({
    url:'http://elm.cangdu.org/shopping/v2/menu',
    params
})

//评价
export const ratings =(id,params)=>axios({
    url:'https://elm.cangdu.org/ugc/v2/restaurants/'+id+'/ratings?offset=0&limit=10',
    params
})

//登录验证
export const captchas =()=>axios({
    url:'/v1/captchas',
    method:'post'
})

//登录
export const login =data=>axios({
    url:'http://192.168.102.39:8001/v2/login',
    method:'post',
    data
})

//标签分类
export const tags =id=>axios({
    url:'https://elm.cangdu.org/ugc/v2/restaurants/'+id+'/ratings/tags'
})

//获取商品详情
export const menuDetails=id=>axios({
    url:'/shopping/v2/menu/'+id
})